from hippo_api.libs import SSH

# 用户第一次创建连接某台主机时，校验连接信息的
def valid_ssh(hostname, port, username, password=None):
    ssh = SSH(hostname, port=port, username=username,password=password)
    try:
        ssh.ping()
    except Exception as e:
        return False

    return True

